package com.hyg.module_testing.ui.fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hyg.lib_common.ui.activity.TestSelfJingshenActivity;
import com.hyg.lib_common.ui.activity.TestSelfTizhiActivity;
import com.hyg.module_testing.R;
import com.hyg.module_testing.databinding.FragmentTestingSelfBinding;

public class TestingSelfFragment extends Fragment {
    FragmentTestingSelfBinding binding;


    public TestingSelfFragment() {
        // Required empty public constructor
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        binding = FragmentTestingSelfBinding.inflate(inflater, container, false);
        init();
        return binding.getRoot();
    }

    public void init() {
        binding.btnTizhiComplete.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), TestSelfTizhiActivity.class);
                intent.putExtra("type","体质辨识完整版");
                startActivity(intent);
            }
        });
        binding.btnTizhiSimplicity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), TestSelfTizhiActivity.class);
                intent.putExtra("type","体质辨识简易版");
                startActivity(intent);
            }
        });

        binding.btnYiyu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), TestSelfJingshenActivity.class);
                intent.putExtra("type","抑郁辨识");
                startActivity(intent);
            }
        });
        binding.btnJiaolv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), TestSelfJingshenActivity.class);
                intent.putExtra("type","焦虑辨识");
                startActivity(intent);
            }
        });
        binding.btnShimian.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), TestSelfJingshenActivity.class);
                intent.putExtra("type","失眠检测");
                startActivity(intent);
            }
        });
        binding.btnYali.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getActivity(), TestSelfJingshenActivity.class);
                intent.putExtra("type","心里压力测试");
                startActivity(intent);
            }
        });
    }


}